using Gateway.Domain.EFCore.Configuration;
using Gateway.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Gateway.Domain.Configuration;

public class ProjectConfiguration : AggregateRootEntityConfiguration<Project>
{
    public override void Configure(EntityTypeBuilder<Project> builder)
    {
        base.Configure(builder);
        builder.ToTable(t => t.HasComment("项目表"));
        builder.Property(x => x.ProjectName).IsRequired().HasMaxLength(200).HasComment("项目名称");
        builder.Property(x => x.ProjectCode).IsRequired().HasMaxLength(50).HasComment("项目编码");

        builder.Property(x => x.SeqNo).IsRequired().HasComment("排序序号");
    }
}